import {action, Service, util} from "adajs";
import LgbtableList from "../../lists/lgbtable";

class LgbtableService extends Service {
    defaultData() {
        return {
            keywordName: "xm",
            list: {
                url: "/api/lgb/app/lgb/oldperson/queryPage",
                type: LgbtableList,
                parameter: {}
            },
            btns: []
        };
    }

    onupdate(current, data) {
        return util.extend(current, data);
    }

    @action("search")
    search(current, keyword) {
        current.list.parameter = Object.assign({}, current.list.parameter || {}, {[current.keywordName]: keyword});
    }

}

export default LgbtableService;